<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用访问器批量设置属性</title>
</head>
<body>
    <script>
        let hd = {
            data : {name : "xiasnn",url : "hoodunren.com"},
            set site(value){
                // 解构赋值
                [this.data.name,this.data.url] = value.split(',');
            },
            get site(){
                return `${this.data.name}的网址是${this.data.url}`;
            }
        };
        hd.site = "后盾人,http://www.houdunren.com";
        console.log(hd.site);
    </script>
</body>
</html>